﻿using System;
using System.Collections.Generic;
using System.Text;
using DTO;
using DAO;

namespace BUS
{
    public class KhachHangBUS
    {
        public static int KtMaKH(long maKH)
        {
            long temp = KhachHangDAO.KtMaKH(maKH);

            if (temp == 0)
                return 1;
            return 0;
        }

        public static int ThemKH(KhachHangDTO KH)
        {
            long tp1 = 0;
            int temp = 0;

            tp1 = KhachHangBUS.KtMaKH(KH.MaKH);

            if (tp1 == 1)
                temp = KhachHangDAO.ThemKH(KH);

            if (tp1 == 0)
                return -1;

            return temp;
        }

        public static List<KhachHangDTO> LayDSKH()
        {
            return KhachHangDAO.LayDSKH();
        }

        public static List<KhachHangDTO> LayDSKHTheoMPT(long mPT)
        {
            return KhachHangDAO.LayDSKHTheoMPT(mPT);
        }
    }
}
